//用来计算固定时间到当前时间的天数

export function day(year,month,day){
    let newDate = new Date()
    let newYear= newDate.getFullYear() //获取完整的年份(4位)
    let newMonth = newDate.getMonth()  //获取当前月份(0-11,0代表1月)
    let newDay = newDate.getDate() //获取当前日(1-31)

    let days = 0

    let newDays = newMonth * 30 + newDay

    

    let oldDays = (month - 1) * 30 + day

    if(newYear - year > 1){
        days = (newYear - year - 1) * 360
        days = days + newDays + (360 - oldDays)
    }else if(newYear - year === 0){
        days = newDays - oldDays
    }else{
        days =  newDays + (360 - oldDays)
    }

    return days

}
